package py.com.erpone.session.dm.list;

import java.util.List;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import py.com.erpone.entity.dm.Laboratorio;

/**
 * Session Bean implementation class LaboratorioList
 */
@Stateless
@LocalBean
@Named
public class LaboratorioList {

    /**
     * Default constructor. 
     */
  
    	@PersistenceContext
    	private EntityManager em;
    	
    
    	@SuppressWarnings("unchecked")
    	public List<Laboratorio> findAll(){
    		List<Laboratorio> result=(List<Laboratorio>)em.createNamedQuery("laboratorio.all").getResultList();
    		return result;
    	}
    	
    	public Laboratorio findById(Long id){
    		return em.find(Laboratorio.class, id);
    	}
    	
    	
    	
    }
